package com.szakul.pdf.viewer.dao.impl;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.szakul.pdf.viewer.dao.beans.UserBean;
import com.szakul.pdf.viewer.dao.beans.UserDao;



public class UserDaoImpl implements UserDao{

	private SessionFactory sessionFactory;
	
    public UserDaoImpl(final SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }

    public UserDaoImpl() {

    }
	
	
	public int createTask(UserBean user) {
		
        Integer id = -1;

        final Session session = sessionFactory.getCurrentSession();

        id = (Integer)session.save(user);

        return id;
		
	}

}
